<?php
class SessionAction extends Action{
	public function login(){
		$this->assign('ttest','not run');
		if (service('Passport')->isLogin()) {
			$this->assign('ttest','rkkkkkkkun');
		}
		$this->assign('test',C('SINA_CONFIG.WB_AKEY'));
		$this->display();
		//
		//		include_once(SITE_PATH . "/addons/plugins/login/{$_GET['type']}.class.php");
		//        $platform = new $_GET['type']();
		//        redirect($platform->getUrl());
	}

	public function session(){
		if ( !in_array($_SESSION['open_platform_type'], array('sina')) ) {
			$this->error('授权失败');
		}
	}

	public function logout(){
		$service('Passport')-> doLogout();
	}

	public function callback(){
		include_once( SITE_PATH.'/Common/lib/sina.class.php' );
		$sina = new sina();
		$sina->checkUser();
		redirect(U('session/session'));
	}


}
?>